<template>
<div style="background:#eee;padding:5px" class="project_model">
    <Card style="width:100%">
        <p slot="title">
            <Icon type="ios-film-outline"></Icon>
            项目列表
        </p>
        <Dropdown style="margin-left: 20px" slot="extra"  @on-click="getCreateConfirm">
            <Button type="primary">
                更多操作
                <Icon type="arrow-down-b"></Icon>
            </Button>
            <DropdownMenu slot="list">
                <DropdownItem  name="1">
                    <Icon type="plus-round"></Icon>
                    创建项目
                </DropdownItem>
                <DropdownItem name="2">
                    <Icon type="ios-loop-strong"></Icon>
                    刷新
                </DropdownItem>
            </DropdownMenu>
        </Dropdown>
        
        <Table border :columns="columns7" :data="data6"></Table>
        <Page :total="100" show-elevator style="margin-top:20px"></Page>

    </Card>

    <modal :modals="modalstatus"
    @changestatus="change_modal"></modal>
</div>
    
</template>
<script>
import Util from '../../libs/util';
import CreateProject from './components/createproject'
import modal from './modal/createpro'
    export default {
        components:{
            CreateProject,
            modal
        },
        data () {
            return {
                columns7: [
                    {
                        title: '项目名称',
                        key: 'name',
                        render: (h, params) => {
                            return h('div', [
                                h('Icon', {
                                    props: {
                                        type: 'person'
                                    }
                                }),
                                h('strong', params.row.name)
                            ]);
                        }
                    },
                    {
                        title: '创建时间',
                        key: 'displayName'
                    },
                    {
                        title: '项目状态',
                        key: 'isStatic'
                    },
                    {
                        title: '负责人',
                        key: 'id'
                    },
                    {
                        title: '操作',
                        key: 'action',
                        width: 150,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'primary',
                                        size: 'small'
                                    },
                                    style: {
                                        marginRight: '5px'
                                    },
                                    on: {
                                        click: () => {
                                            this.show(params.index)
                                        }
                                    }
                                }, '修改'),
                                h('Button', {
                                    props: {
                                        type: 'error',
                                        size: 'small'
                                    },
                                    on: {
                                        click: () => {
                                            this.remove(params.index)
                                        }
                                    }
                                }, '删除')
                            ]);
                        }
                    }
                ],
                data6: [
                ],
                value:'',
                modalstatus:false,
                modal2:false,
                modal_loading: false,
            }
        },
        methods: {
            show (index) {
                this.$Modal.confirm({
                    render: (h) => {
                        return h(CreateProject)
                    }
                })
            },
            remove (index) {
                this.data6.splice(index, 1);
            },
            getCreateConfirm(index){
                this.modalstatus=true
                console.log(this.modalstatus)
            },
            change_modal (status) {
                this.modalstatus = status
            }
        },
        created(){
            Util.ajax.get('/api/services/app/Role/GetAll?SkipCount=1&MaxResultCount=10').then(result=>{
                this.data6 = result.data.result.items;
                console.log(this.data6)
            })
        }
    }
</script>
<style lang="less" scoped>
.project_model /deep/.ivu-modal-confirm-footer{
    display: none;
}
</style>

